//
//  CustomTableViewCell.swift
//  拾舍清洁
//
//  Created by sky.wei on 2023/3/5.
//

//import UIKit
//
//typealias IndexPathClosure = (_ indexPath: NSIndexPath) ->Void
//class CustomTableViewCell: UITableViewCell {
//
//        var choiceBtn: UIButton?
//        var displayLab: UILabel?
//
//        var indexPath: NSIndexPath?
//
//        var indexPathClosure: IndexPathClosure?
//
//        override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
//            super.init(style: style, reuseIdentifier: reuseIdentifier)
//
//            self.initializeUserInterface()
//
//        }
//
//        required init?(coder aDecoder: NSCoder) {
//            fatalError("init(coder:) has not been implemented")
//        }
//
//        // MARK:Initialize methods
//        func initializeUserInterface() {
//
//            self.choiceBtn = {
////                let choiceBtn = UIButton(type: UIButtonType.Custom)
////                choiceBtn.bounds = CGRect(0, 0, 30, 30)
////                choiceBtn.center = CGPointMake(20, 22)
////                choiceBtn.setBackgroundImage(UIImage(named: "iconfont-select"), forState: UIControlState.Normal)
////                choiceBtn.setBackgroundImage(UIImage(named: "iconfont-selected"), forState: UIControlState.Selected)
////                choiceBtn.addTarget(self, action: Selector("respondsToButton:"), forControlEvents: UIControlEvents.TouchUpInside)
//
//        let choiceBtn = UIButton(type: .custom)
//        choiceBtn.bounds = CGRect(x: 0, y: 0, width: 30, height: 30)
//                    choiceBtn.center = CGPoint(x: 20, y: 20)
//        choiceBtn.setBackgroundImage(UIImage(named: "iconfont-select"), for: .normal)
//        choiceBtn.setBackgroundImage(UIImage(named: "iconfont-select"), for: .selected)
//        choiceBtn.addTarget(self, action: #selector(btnTapped(_:)), for: .touchUpInside)
////        UIButton(type: UIButtonType.Custom)
////                    choiceBtn.bounds = CGRect(0, 0, 30, 30)
////                    choiceBtn.center = CGPointMake(20, 22)
////                    choiceBtn.setBackgroundImage(UIImage(named: "iconfont-select"), forState: UIControlState.Normal)
////                    choiceBtn.setBackgroundImage(UIImage(named: "iconfont-selected"), forState: UIControlState.Selected)
////                    choiceBtn.addTarget(self, action: Selector("respondsToButton:"), forControlEvents: UIControlEvents.TouchUpInside)
//
//                return choiceBtn
//                }()
//            self.contentView.addSubview(self.choiceBtn!)
//
//            self.displayLab = {
//                let displayLab = UILabel()
//        displayLab.bounds = CGRect(x: 0, y: 0, width: 100, height: 30)
//        displayLab.center = CGPoint(x: 10, y: 10)
//        displayLab.textAlignment = .left
////                displayLab.bounds = CGRectMake(0, 0, 100, 30)
////                displayLab.center = CGPointMake(CGRectGetMaxX(self.choiceBtn!.frame) + 60, CGRectGetMidY(self.choiceBtn!.frame))
////                displayLab.textAlignment = NSTextAlignment.Left
//                return displayLab
//                }()
//            self.contentView.addSubview(self.displayLab!)
//
//        }
//
//        // MARK:Events
//      @objc func respondsToButton(sender: UIButton) {
//            sender.isSelected = true
//            if self.indexPathClosure != nil {
//                self.indexPathClosure!(indexPath: self.indexPath!)
//            }
//        }
//
//
//        // MARK:Private
//        func setChecked(checked: Bool) {
//
//            self.choiceBtn?.isSelected = checked
//
//        }
//
//        func getIndexWithClosure(closure: IndexPathClosure?) {
//            self.indexPathClosure = closure
//        }
//
//                            @objc func btnTapped(_ button:UIButton){
//
//        }
//    }
